import { isLogin } from "@utils/WeStudyUtil";
import { Navigate } from "react-router-dom";

export default function AuthRoute({ children }: any) {
  const isAuthenticated = isLogin();
  if (!isAuthenticated) {
    return <Navigate to="/login"></Navigate>;
  }
  return children;
}